#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 2e5 + 10;

int n;
vector<int> nums;
char str[N];

void solve(){
    nums.clear();

    scanf("%d", &n);
    scanf("%s", str + 1);

    LL res = 0;
    for(int i = 1; i <= n; i ++){
        char c = str[i];
        if(c == 'L'){
            int cur = i - 1;
            int change = n - i;
            if(cur < change){
                nums.push_back(change - cur);
            }
            res = (LL)cur + res;
        }else{
            int cur = n - i;   //R
            int change = i - 1;   //L
            if(cur < change){
                nums.push_back(change - cur);
            }
            res = (LL) cur + res;
        }
    }
    if(!nums.empty()){
        sort(nums.begin(), nums.end(), greater<int>());
        

        for(int i = 1; i <= n; i ++){
            if(i - 1 > nums.size() - 1){
                printf("%lld ", res);
            }else{
                res = (LL)nums[i - 1] + res;
                printf("%lld ", res);
            }
        }

        printf("\n");
    }else{
        for(int i = 1; i <= n; i ++){
            printf("%lld ", res);
        }
        printf("\n");
    }

}


// L = i - 1, R = n - i
int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);

    int T;
    scanf("%d", &T);
    while(T--){
        solve();
    }

    return 0;
}